/* 
    收藏帖子数据库模型
*/
import { SchemaFactory, Prop, Schema } from '@nestjs/mongoose'
import mongoose, { Document } from 'mongoose'
import { Proposition } from './proposition.schema'
import { User } from './UserSchema.Schema'

export type CollectDocument = Collect & Document

@Schema({ timestamps: true })
export class Collect {
  @Prop({ ref: User.name, required: true })
  user: mongoose.Types.ObjectId
  @Prop({ ref: Proposition.name, required: true })
  proposition: mongoose.Types.ObjectId
}

export const collectSchema = SchemaFactory.createForClass(Collect)
